'''
    Time Format methods
    Time Sample: "Tue May 31 17:46:55 +0800 2011"
'''

class Time():
    
    mMonthDict = {'Jan' :   '01', 'Feb':   '02', 'Mar':   '03', 'Apr':   '04',\
                  'May' :   '05', 'Jun':   '06', 'Jul':   '07', 'Aug':   '08',\
                  'Sep' :   '09', 'Oct':   '10', 'Nov':   '11', 'Dec':   '12'}
        
    def _getYear(self):
        self.mYear = self.mTimeStr[-4:]
        
    def _getMonth(self):
        lMonthKey = self.mTimeStr[4:7]
        self.mMonth = self.mMonthDict[lMonthKey]
        
    def _getDay(self):
        self.mDay = self.mTimeStr[8:10]
        
    def _getHour(self):
        self.mHour = self.mTimeStr[11:13]
        
    def _getMinute(self):
        self.mMinute = self.mTimeStr[14:16]
        
    def _process(self):
        self._getYear()
        self._getMonth()
        self._getDay()
        self._getHour()
        self._getMinute()
        
    def getMinuteId(self, iTimeStr):
        self.mTimeStr = iTimeStr
        self._process()
        lMinuteId = self.mYear + self.mMonth + self.mDay + self.mHour + self.mMinute
        return lMinuteId
    